package org.example.app.service.dto;

import lombok.Data;
import org.example.app.model.User;

import java.time.LocalDateTime;

@Data
public class UserDto {
    private Integer UserId;

    private LocalDateTime addTime;

    private LocalDateTime updateTime;

    private String username;

    private String realname;

    private Integer count;

    private String email;

    public UserDto(User user){
        this.UserId = user.getId();
        this.username = user.getUsername();
        this.realname = user.getRealname();
        this.email = user.getEmail();
        this.count = user.getCount();
        this.addTime = user.getAddTime();
        this.updateTime = user.getUpdateTime();
    }

    public String toString() {
        return "用户名： " +  username + ", 真实姓名: " + realname +  ", 邮箱： " + email + "\n";
    }

}

